<template>
  <div id="allmap">
    <div id="mapZZZ"></div>
    <!-- 地图图标显示选择器 -->
    <!-- <div class="person_top">
      <p>
        <span>
          <input id="checkbox_car" type="checkbox" checked />
        </span>
        <span style="font-size: 12px;">车辆</span>
      </p>
      <p>
        <span>
          <input id="checkbox_clc" type="checkbox" checked @click="handleCheckCLC" />
        </span>
        <span style="font-size: 12px;">处理厂</span>
      </p>
      <p>
        <span>
          <input id="checkbox_zzz" type="checkbox" @click="handlephotoCheckZZZ" />
        </span>
        <span style="font-size: 12px;">转运站</span>
      </p>
      <p>
        <span>
          <input id="checkbox_large" type="checkbox" @click="handleCheckLarge" />
        </span>
        <span style="font-size: 12px;">大中型餐饮单位</span>
      </p>
      <p>
        <span>
          <input id="checkbox_small" type="checkbox" @click="handleCheckSmall" />
        </span>
        <span style="font-size: 12px;">沿街小型商铺</span>
      </p>
      <p>
        <span>
          <input id="checkbox_village" type="checkbox" @click="handleCheckVillage" />
        </span>
        <span style="font-size: 12px;">小区厨余垃圾点</span>
      </p>
      <p>
        <span>
          <input id="checkbox_carLabel" type="checkbox" checked @change="showPoint" />
        </span>
        <span style="font-size: 12px;">车辆标签</span>
      </p>
    </div>-->
    <!-- 左侧面板 -->
    <div class="map-infos-wrap">
      <div class="map-infos" v-if="showMapInfo">
        <!-- 第一个面板 -->
        <div v-if="mapInfoTabValue === 0">
          <h3>
            综合实时在线统计
            <i>{{ realtimeStatistics.comprehensiveAll }}总数</i>
          </h3>
          <div class="item-wrap">
            <div class="item-con">
              <h2>{{ realtimeStatistics.comprehensiveOnline }}</h2>
              <span>在线</span>
            </div>
            <div class="item-con">
              <h2>
                {{
                  realtimeStatistics.comprehensiveAll -
                  realtimeStatistics.comprehensiveOnline
                }}
              </h2>
              <span>离线</span>
            </div>
          </div>
          <h3>分类情况</h3>
          <el-table
            highlight-current-row
            :data="realtimeStatistics.comprehensiveOnlineData"
            class="card-table"
            style="width: 100%"
            size="mini"
            :header-cell-style="{ height: '40px' }"
            border
            fit
          >
            <el-table-column
              prop="类型"
              label="类型"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="在线数量"
              label="在线数量"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="全部数量"
              label="全部数量"
              align="center"
            ></el-table-column>
            <!-- <el-table-column prop="出车率" label="出车率" align="center"></el-table-column> -->
          </el-table>
          <!-- <h3 style="margin-top: 18px;">车辆分组</h3> -->
          <el-tree style="margin-top: 18px"
            ref="treeVehicle"
            default-expand-all
            :data="dataTree"
            :props="defaultProps"
            node-key="VID"
            :render-content="renderContent"
          ></el-tree>
        </div>
        <!-- 第二个面板 -->
        <div v-if="mapInfoTabValue === 1">
          <h3>
            道路机扫车辆实时在线统计
            <i>{{ realtimeStatistics.vehicleAll }}辆</i>
          </h3>
          <div class="item-wrap">
            <div class="item-con">
              <h2>{{ realtimeStatistics.vehicleOnline }}</h2>
              <span>在线</span>
            </div>
            <div class="item-con">
              <h2>
                {{
                  realtimeStatistics.vehicleAll -
                  realtimeStatistics.vehicleOnline
                }}
              </h2>
              <span>离线</span>
            </div>
          </div>
          <h3>道路机扫车辆分类情况</h3>
          <el-table
            :data="realtimeStatistics.vehicleOnlineData"
            class="card-table"
            style="width: 100%"
            size="mini"
            :header-cell-style="{ height: '40px' }"
            border
            fit
          >
            <el-table-column
              prop="类型"
              label="类型"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="在线数量"
              label="在线车量"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="全部数量"
              label="全部车量"
              align="center"
            ></el-table-column>
          </el-table>
        </div>
        <!-- 第三个面板 -->
        <div v-if="mapInfoTabValue === 2">
          <h3>
            垃圾收运车辆实时在线统计
            <i>{{ realtimeStatistics.rubbishAll }}辆</i>
          </h3>
          <div class="item-wrap">
            <div class="item-con">
              <h2>{{ realtimeStatistics.rubbishOnline }}</h2>
              <span>在线</span>
            </div>
            <div class="item-con">
              <h2>
                {{
                  realtimeStatistics.rubbishAll -
                  realtimeStatistics.rubbishOnline
                }}
              </h2>
              <span>离线</span>
            </div>
          </div>
          <h3>垃圾收运车辆分类情况</h3>
          <el-table
            :data="realtimeStatistics.rubbishOnlineData"
            class="card-table"
            style="width: 100%"
            size="mini"
            :header-cell-style="{ height: '40px' }"
            border
            fit
          >
            <el-table-column
              prop="类型"
              label="类型"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="在线数量"
              label="在线车量"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="全部数量"
              label="全部车量"
              align="center"
            ></el-table-column>
          </el-table>
        </div>
        <!-- 第四个面板 -->
        <div v-if="mapInfoTabValue === 3">
          <h3>
            环卫保洁人员实时在线统计
            <i>{{ realtimeStatistics.workerAll }}人</i>
          </h3>
          <div class="item-wrap">
            <div class="item-con">
              <h2>{{ realtimeStatistics.workerOnline }}</h2>
              <span>在线</span>
            </div>
            <div class="item-con">
              <h2>
                {{
                  realtimeStatistics.workerAll - realtimeStatistics.workerOnline
                }}
              </h2>
              <span>离线</span>
            </div>
          </div>
          <h3>环卫保洁人员分类情况</h3>
          <el-table
            :data="realtimeStatistics.workerOnlineData"
            class="card-table"
            style="width: 100%"
            size="mini"
            :header-cell-style="{ height: '40px' }"
            border
            fit
          >
            <el-table-column
              prop="名称"
              label="名称"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="在线人数"
              label="在线人数"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="全部人数"
              label="全部人数"
              align="center"
            ></el-table-column>
          </el-table>
        </div>
        <!-- 第五个面板 -->
        <div v-if="mapInfoTabValue === 4">
          <h3>
            维保车辆实时在线统计
            <i>{{ realtimeStatistics.wcCarAll }}辆</i>
          </h3>
          <div class="item-wrap">
            <div class="item-con">
              <h2>{{ realtimeStatistics.wcCarOnline }}</h2>
              <span>在线</span>
            </div>
            <div class="item-con">
              <h2>
                {{
                  realtimeStatistics.wcCarAll - realtimeStatistics.wcCarOnline
                }}
              </h2>
              <span>离线</span>
            </div>
          </div>
          <h3>
            维保人员实时在线统计
            <i>{{ realtimeStatistics.wcWorkerAll }}人</i>
          </h3>
          <div class="item-wrap">
            <div class="item-con">
              <h2>{{ realtimeStatistics.wcWorkerOnline }}</h2>
              <span>在线</span>
            </div>
            <div class="item-con">
              <h2>
                {{
                  realtimeStatistics.wcWorkerAll -
                  realtimeStatistics.wcWorkerOnline
                }}
              </h2>
              <span>离线</span>
            </div>
          </div>
        </div>
        <!-- 第六个面板 -->
        <div v-if="mapInfoTabValue === 5">
          <h3>
            设施图层
            <!-- <i>466个</i> -->
          </h3>
          <div class="icon-wrap">
            <div
              class="icon-con"
              v-for="(item, index) in mapOperationsList"
              :class="{ hasColor: item.active }"
              :key="index"
              @click="changeOperationValue(item, index)"
            >
              <i :class="item.icon"></i>
              <el-tag effect="dark" size="mini">{{ item.num }}</el-tag>
              <span>{{ item.name }}</span>
            </div>
          </div>
        </div>
        <div v-if="mapInfoTabValue === 6">
          <h3>
            地图图层
            <!-- <i>466个</i> -->
          </h3>
          <div class="icon-wrap">
            <div
              class="icon-con"
              v-for="(item, index) in mapFeatureList"
              :class="{ hasColor: item.active }"
              :key="index"
              
            >
              <el-checkbox @change="changeMapfeature" v-model="item.active">{{ item.name }}</el-checkbox>
              <!-- <i :class="item.icon"></i> -->
              <!-- <el-tag effect="dark" size="mini">{{ item.num }}</el-tag> -->
              <!-- <span>{{ item.name }}</span> -->
            </div>
          </div>
        </div>
      </div>
      <!-- 面板切换选项卡 -->
      <div class="info-tabs">
        <a
          v-for="(item, index) in mapInfoTabs"
          :class="{ active: mapInfoTabValue === index }"
          :key="index"
          @click="changeMapInfoTabValue(index)"
        >
          <i :class="item.icon"></i>
        </a>
      </div>
    </div>
    <!-- 图例 -->
    <div class="person_legend" v-if="showLegend">
      <h3>
        图例
        <i class="iconfont icon-shanchu" @click="showLegend = false"></i>
      </h3>
      <p>
        <span>
          <img :src="legend.carJISAO" alt />
        </span>
        <span  style="font-size: 0.625vw">洗扫车</span>
      </p>
      <!-- <p>
        <span>
          <img :src="legend.carXXJISAO" alt />
        </span>
        <span style="font-size: 0.625vw">小型机扫车</span>
      </p> -->
      <p>
        <span>
          <img :src="legend.carSASHUI" alt />
        </span>
        <span style="font-size: 0.625vw">洒水车</span>
      </p>
      <p>
        <span>
          <img :src="legend.carXILU" alt />
        </span>
        <span style="font-size: 0.625vw">洗路车</span>
      </p>
      <p>
        <span>
          <img :src="legend.carXICHEN" alt />
        </span>
        <span style="font-size: 0.625vw">吸尘车</span>
      </p>
      <p>
        <span>
          <img :src="legend.carGYQINGXI" alt />
        </span>
        <span style="font-size: 0.625vw">高压清洗车</span>
      </p>
      <!-- <p>
        <span>
          <img :src="legend.carCHUXUE" alt />
        </span>
        <span style="font-size: 0.625vw">除雪车</span>
      </p> -->
      <p>
        <span>
          <img :src="legend.carCANCHU" alt />
        </span>
        <span style="font-size: 0.625vw">餐厨车</span>
      </p>
      <p>
        <span>
          <img :src="legend.carGOUBI" alt />
        </span>
        <span style="font-size: 0.625vw">勾臂车</span>
      </p>
      <p>
        <span>
          <img :src="legend.carXIFEN" alt />
        </span>
        <span style="font-size: 0.625vw">吸粪车</span>
      </p>
      <p>
        <span>
          <img :src="legend.carXXLAJI" alt />
        </span>
        <span style="font-size: 0.625vw">垃圾车</span>
      </p>
      <!-- <p>
        <span>
          <img :src="legend.carJIYA" alt />
        </span>
        <span style="font-size: 0.625vw">挤压车</span>
      </p> -->
 
      <!-- <p>
        <span>
          <img :src="legend.carXXLAJI" alt />
        </span>
        <span style="font-size: 0.625vw">小型垃圾车</span>
      </p> -->
      <!-- <p>
        <span>
          <img :src="legend.carYHLAJI" alt />
        </span>
        <span style="font-size: 0.625vw">有害垃圾车</span>
      </p> -->
      <p>
        <span>
          <img :src="legend.carQITA" alt />
        </span>
        <span style="font-size: 0.625vw">其他车</span>
      </p>
    </div>

    <!-- 右上方显示隐藏图标操作栏,单选 -->
    <el-dropdown
      size="small"
      placement="bottom"
      trigger="click"
      @command="batchOperate"
      style="position: absolute; right: 30px; top: 25px"
    >
      <el-button size="mini" type="primary" icon="el-icon-more"></el-button>
      <!-- <el-button class="search-btn" size="mini">
        其他操作

        <i class="el-icon-arrow-down el-icon--right"></i>
      </el-button> -->

      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item command="batch_remarks">测算面积</el-dropdown-item>
        <el-dropdown-item command="export_excel">测距</el-dropdown-item>
        <el-dropdown-item command="findcar">范围查找</el-dropdown-item>
        <el-dropdown-item command="findcarc">框选查找</el-dropdown-item>
        <el-dropdown-item command="photo">存为图片</el-dropdown-item>
        <el-dropdown-item v-if="!isMapWX" command="wx">卫星地图</el-dropdown-item>
        <el-dropdown-item v-if="isMapWX" command="pt">普通地图</el-dropdown-item>

      </el-dropdown-menu>
    </el-dropdown>

    <el-button
      style="position: absolute; right: 84px; top: 25px"
      size="mini"
      type="primary"
      @click="onlyShowHeader()"
      icon="el-icon-circle-close"
      >隐藏其它</el-button
    >
    <el-button
      style="position: absolute; right: 206px; top: 25px"
      size="mini"
      type="primary"
      @click="requestFullScreen()"
      v-if="!isFull"
      icon="el-icon-full-screen"
      >全屏</el-button
    >
    <el-button
      style="position: absolute; right: 346px; top: 25px"
      size="mini"
      type="primary"
      @click="exitFullscreen()"
      v-else
      icon="el-icon-full-screen"
      >退出全屏</el-button
    >
    <!-- 右上方显示隐藏图标操作栏,单选 -->
    <!-- <div class="map-operation">
      <ul>
        <li v-for="(item,index) in mapOperationsList" :class="{'active': operationValue === index}" :key="index" @click="changeOperationValue(item, index)">
          <i :class="item.icon"></i>
          {{ item.name }}
        </li>
      </ul>
    </div>-->
    <!-- 右上方显示隐藏图标操作栏,多选 -->
    <div class="map-operation">
      <ul>
        <li
          v-for="(item, index) in mapOperationsSummary"
          :class="{ active: item.active }"
          :key="index"
          @click="changeOperationSummary(item, index)"
        >
          <i :class="item.icon"></i>
          {{ item.name }}
        </li>
      </ul>
    </div>
    <!-- 左下角 列表展开按钮-->
    <div class="mini_legend" v-if="hideFooter" @click="showFooter()">
      实时监控列表
    </div>
    <!-- 右下角 图例展开按钮-->
    <div
      class="mini_legend right"
      v-if="!showLegend"
      @click="showLegend = !showLegend"
    >
      图例
    </div>
    <!-- 范围找车 数据列表 -->
    <el-dialog
      :title="titleDialogRange"
      :visible.sync="isShowDialogRange"
      width="55%"
      class="dialogchild"
    >
      <el-table
        :data="arrPointIn"
        style="width: 150%"
        fit
        max-height="550"
        highlight-current-row
      >
        <el-table-column
          prop="LICENSEPLATE"
          label="车辆名称"
          width="180"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="CARTYPE"
          label="车辆类型"
          width="120"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="GPSTIME"
          label="定位时间"
          width="180"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="LNG"
          label="经度"
          width="140"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="LAT"
          label="纬度"
          width="140"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="SPEED"
          label="速度"
          width="100"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="CLIENTNAME"
          label="分组"
          width="140"
          align="center"
        ></el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>

<script>
//机扫车辆
import imgCarJISAO from '@/assets/img/MapMarker/vehicleCar/jisao.png'
import imgCarXXJISAO from '@/assets/img/MapMarker/vehicleCar/xxjisao.png'
import imgCarXICHEN from '@/assets/img/MapMarker/vehicleCar/xichen.png'
import imgCarXILU from '@/assets/img/MapMarker/vehicleCar/xilu.png'
import imgCarSASHUI from '@/assets/img/MapMarker/vehicleCar/sashui.png'
import imgCarCHUXUE from '@/assets/img/MapMarker/vehicleCar/chuxue.png'
import imgCarGYQINGXI from '@/assets/img/MapMarker/vehicleCar/gyqingxi.png'
import imgCarQITA from "@/assets/img/MapMarker/vehicleCar/qita.png";
//机扫车辆 离线
import imgCarJISAO0 from '@/assets/img/MapMarker/vehicleCar/jisaoUnline.png'
import imgCarXXJISAO0 from '@/assets/img/MapMarker/vehicleCar/xxjisaoUnline.png'
import imgCarXICHEN0 from '@/assets/img/MapMarker/vehicleCar/xichenUnline.png'
import imgCarXILU0 from '@/assets/img/MapMarker/vehicleCar/xiluUnline.png'
import imgCarSASHUI0 from '@/assets/img/MapMarker/vehicleCar/sashuiUnline.png'
import imgCarCHUXUE0 from '@/assets/img/MapMarker/vehicleCar/chuxueUnline.png'
import imgCarGYQINGXI0 from '@/assets/img/MapMarker/vehicleCar/gyqingxiUnline.png'
//垃圾车辆
import imgCarCANCHU from '@/assets/img/MapMarker/rubbishCar/canchu.png'
import imgCarXXLAJI from '@/assets/img/MapMarker/rubbishCar/xxlaji.png'
import imgCarYHLAJI from '@/assets/img/MapMarker/rubbishCar/yhlaji.png'
import imgCarGOUBI from '@/assets/img/MapMarker/rubbishCar/goubi.png'
import imgCarXIFEN from '@/assets/img/MapMarker/rubbishCar/xifen.png'
import imgCarZIXIE from '@/assets/img/MapMarker/rubbishCar/zixie.png'
import imgCarJIYA from '@/assets/img/MapMarker/rubbishCar/jiya.png'
import imgCarXXCHONGXI from '@/assets/img/MapMarker/rubbishCar/xxchongxi.png'
//垃圾车辆 离线
import imgCarCANCHU0 from '@/assets/img/MapMarker/rubbishCar/canchuUnline.png'
import imgCarXXLAJI0 from '@/assets/img/MapMarker/rubbishCar/xxlajiUnline.png'
import imgCarYHLAJI0 from '@/assets/img/MapMarker/rubbishCar/yhlajiUnline.png'
import imgCarGOUBI0 from '@/assets/img/MapMarker/rubbishCar/goubiUnline.png'
import imgCarXIFEN0 from '@/assets/img/MapMarker/rubbishCar/xifenUnline.png'
import imgCarZIXIE0 from '@/assets/img/MapMarker/rubbishCar/zixieUnline.png'
import imgCarJIYA0 from '@/assets/img/MapMarker/rubbishCar/jiyaUnline.png'
//人员
import imgWorkerBZZ from '@/assets/img/MapMarker/worker/banzuzhang.png'
import imgWorkerBJY from '@/assets/img/MapMarker/worker/baojieyuan.png'
//人员 离线
import imgWorkerBZZ0 from '@/assets/img/MapMarker/worker/banzuzhangUnline.png'
import imgWorkerBJY0 from '@/assets/img/MapMarker/worker/baojieyuanUnline.png'
//公厕人员
import imgToiletWorkerLD from '@/assets/img/MapMarker/wcWorker/liudong.png'
import imgToiletWorkerZC from '@/assets/img/MapMarker/wcWorker/zhuchang.png'
//公厕人员 离线
import imgToiletWorkerLD0 from '@/assets/img/MapMarker/wcWorker/liudongUnline.png'
import imgToiletWorkerZC0 from '@/assets/img/MapMarker/wcWorker/zhuchangUnline.png'
//垃圾设施
import imgMarkerCLC from '@/assets/img/marker/markerImageCLC.png'
import imgMarkerNCD from '@/assets/img/marker/markerImageLarge.png'
import imgMarkerCY from '@/assets/img/marker/markerImageSmall.png'
import imgMarkerXQCY from '@/assets/img/marker/markerImageVillage.png'
import imgMarkerZZZ from '@/assets/img/marker/markerImageZZZ.png'
//公厕设施
import imgToiletDMDX from '@/assets/img/MapMarker/wcToilet/dimiandixia.png'
import imgToiletDL from '@/assets/img/MapMarker/wcToilet/duli.png'
import imgToiletFJ from '@/assets/img/MapMarker/wcToilet/fujian.png'
import imgToiletYD from '@/assets/img/MapMarker/wcToilet/yidong.png'
import closeBtnImg from "@/assets/img/define.png";

import warningMark from '@/assets/img/warning-mark.png'
import eventBus from '@/eventBus.js'
import MapStr from '@/main.js'
import Schart from 'vue-schart';
import { newMap } from '@/common/js/map.js'
import { setCenterOffset } from "@/common/js/map.js";
import html2canvas from "html2canvas";
export default {
  components: {
    Schart
  },
  data () {
    return {
      MouseEvent: {
        top: 0,
        left: 0,
        isShow: false
      },
      dataTree: [],
      defaultProps: {
        children: "subs",
        label: "LICENSE_PLATE",
      },
      isFull: false,
      isMapWX: false,
      map: null,
      mapZoom: 16,
      isZoomChange: 'S',
      // 班组区域
      groupPolygon: null,
      cleanerPolygon: null,
      mapCursor: null,
      mapDrawingManager: null,
      mapDrawingrectangleManager: null,
      arrPointIn: [],
      status: {},
      legend: {
        //机扫车辆
        carJISAO: imgCarJISAO,
        carXXJISAO: imgCarXXJISAO,
        carXICHEN: imgCarXICHEN,
        carXILU: imgCarXILU,
        carSASHUI: imgCarSASHUI,
        carGYQINGXI: imgCarGYQINGXI,
        carCHUXUE: imgCarCHUXUE,
        carQITA: imgCarQITA,
        //垃圾车辆
        carXIFEN: imgCarXIFEN,
        carCANCHU: imgCarCANCHU,
        carGOUBI: imgCarGOUBI,
        carZIXIE: imgCarZIXIE,
        carJIYA: imgCarJIYA,
        carYHLAJI: imgCarYHLAJI,
        carXXLAJI: imgCarXXLAJI,
        carXXCHONGXI: imgCarXXCHONGXI,
        //人员
        workerBZZ: imgWorkerBZZ,
        workerBJY: imgWorkerBJY,
        //垃圾设施
        xqcyOverlay: imgMarkerXQCY,
        ncdOverlay: imgMarkerNCD,
        cyOverlay: imgMarkerCY,
        clcOverlay: imgMarkerCLC,
        zzzOverlay: imgMarkerZZZ,
        //公厕设施
        toiletDMDX: imgToiletDMDX,
        toiletDL: imgToiletDL,
        toiletFJ: imgToiletFJ,
        toiletYD: imgToiletYD,
        //公厕人员
        toiletWorkerLD: imgToiletWorkerLD,
        toiletWorkerZC: imgToiletWorkerZC
      },
      MapOverlay: {
        warningMarker: '',
        arrayCLCMapOverlay: [],
        arrayZZZMapOverlay: [],
        arrayNCDMapOverlay: [],
        arrayCYMapOverlay: [],
        arrayXQCYMapOverlay: [],

        arrayCarMapOverlay: [],
        arrayRubbishMapOverlay: [],
        arrayWorkerMapOverlay: [],
        arrayToiletCarMapOverlay: [],
        arrayToiletWorkerMapOverlay: [],
        arrayToiletMapOverlay: []
      },
      Data: {
        arrayCLCPolygonData: [],

        arrayCLCMarkerData: [],
        arrayZZZMarkerData: [],
        arrayNCDMarkerData: [],
        arrayXQCYMarkerData: [],
        arrayCYMarkerData: [],

        arrayCarData: [],
        arrayRubbishData: [],
        arrayWorkerData: [],
        arrayToiletCarData: [],
        arrayToiletWorkerData: [],
        arrayToiletData: [],

        arrayForType_Veicle: [],
        arrayForType_Rubbish: [],
        arrayForType_Worker: []
      },
      // warningNum: 0,
      // 筛选数据
      hideFooter: false,
      showLegend: true,
      mapInfoTabs: [{
        icon: 'el-icon-document'
      }, {
        icon: 'el-icon-truck'
      }, {
        icon: 'el-icon-truck'
      }, {
        icon: 'el-icon-user'
      }, {
        icon: 'el-icon-toilet-paper'
      }, {
        icon: 'el-icon-collection-tag'
      }, {
        icon: 'el-icon-picture-outline-round'}],
        mapFeatureList: [{
        name: '道路',
        icon: 'el-icon-knife-fork',
        num: 0,
        active: true
      }, {
        name: '陆地',
        icon: 'el-icon-truck',
        num: 0,
        active: true
      }, {
        name: '水系',
        icon: 'el-icon-box',
        num: 0,
        active: true
      }, {
        name: '绿地',
        icon: 'el-icon-house',
        num: 0,
        active: true

      // }, {
      //   name: '建筑物',
      //   icon: 'el-icon-refrigerator',
      //   num: 0,
      //   active: true
      }, {
        name: '建筑点位',
        icon: 'el-icon-knife-fork',
        num: 0,
        active: false
      // }, {
      //   name: '人造区域',
      //   icon: 'el-icon-chicken',
      //   num: 0,
      //   active: true
      }],
      mapInfoTabValue: 0,
      showMapInfo: true,
      mapOperationsSummary: [{
        name: '机扫车辆',
        icon: 'el-icon-truck',
        active: true
      }, {
        name: '清运车辆',
        icon: 'el-icon-truck',
        active: true
      }, {
        name: '人工保洁',
        icon: 'el-icon-user',
        active: false
      }, {
        name: '吸粪车辆',
        icon: 'el-icon-truck',
        active: false
      }, {
        name: '维保人员',
        icon: 'el-icon-user',
        active: false
      }, {
        name: '设施',
        icon: 'el-icon-house',
        active: false
      }],
      mapOperationsList: [{
        name: '机扫车辆',
        icon: 'el-icon-truck',
        active: true
      }, {
        name: '清运车辆',
        icon: 'el-icon-truck',
        active: true
      }, {
        name: '人工保洁',
        icon: 'el-icon-user',
        active: true
      }, {
        name: '吸粪车辆',
        icon: 'el-icon-truck',
        active: true
      }, {
        name: '维保人员',
        icon: 'el-icon-user',
        active: true
      }, {
        name: '公厕',
        icon: 'el-icon-toilet-paper',
        active: false
      }, {
        name: '转运站',
        icon: 'el-icon-box',
        active: false
      }, {
        name: '处理厂',
        icon: 'el-icon-house',
        active: false
      }, {
        name: '农村垃圾点',
        icon: 'el-icon-chicken',
        active: false
      }, {
        name: '小区垃圾点',
        icon: 'el-icon-refrigerator',
        active: false
      }, {
        name: '餐饮单位',
        icon: 'el-icon-knife-fork',
        active: false
      }],
      MapV: {
        dataSetDic_Vehicle: {},
        dataSetDic_Worker: {},
        dataSetDic_Rubbish: {},
        dataSetDic_ToiletCar: {},
        dataSetDic_ToiletWorker: {},
        dataSetDic_Toilet: {},
        textLayerVehicle: {},
        textLayerWorker: {},
        textLayerRubbish: {},
        textLayerToilet: {},
        textLayerToiletCar: {},
        // arrayVIcon_Vehicle: [],
        // arrayVText_Vehicle: [],
        // arrayVIcon_Worker: [],
        // arrayVText_Worker: [],
        // arrayVIcon_Rubbish: [],
        // arrayVText_Rubbish: [],
        VIcon_Installations: {},
        VText_Installations: {}
      },
      // operationValue: '',
      realtimeStatistics: {
        comprehensiveOnlineData: [],
        comprehensiveOnline: '',
        comprehensiveAll: '',
        vehicleOnlineData: [],
        vehicleOnline: '',
        vehicleAll: '',
        rubbishOnlineData: [],
        rubbishOnline: '',
        rubbishAll: '',
        workerOnlineData: [],
        workerOnline: '',
        workerAll: '',
        // workerHWGOnline: '',
        // workerHWGAll: '',
        wcWorkerOnline: '',
        wcWorkerAll: '',
        wcCarOnline: '',
        wcCarAll: '',
      },
      checkbox_large: false,
      checkbox_small: false,
      checkbox_village: false,
      checkbox_carLabel: true,
      isShowDialogRange: false,
      titleDialogRange: "",
    }
  },
  destroyed () {
    
    eventBus.$off('onlineStatisticsComprehensive')
    eventBus.$off('realtimeOnlineStatistics_WC')
    eventBus.$off('realtimeOnlineStatistics_Worker')
    eventBus.$off('realtimeOnlineStatistics_Rubbish')
    eventBus.$off('realtimeOnlineStatistics_Vehicle')
  },
  created () {
    
    // 自动刷新 + 显示人员标记点
    eventBus.$on('mapData_Vehicle', val => {
      this.Data.arrayForType_Veicle = val
      this.drawMapV_Vehicle()
      // this.Data.arrayCarData = val
      // this.handleCheckCar()
    })
    eventBus.$on('mapData_Rubbish', val => {
      this.Data.arrayForType_Rubbish = val
      this.drawMapV_Rubbish()
      // this.Data.arrayRubbishData = val
      // this.handleCheckRubbish()
    })
    eventBus.$on('mapData_Worker', val => {
      this.Data.arrayForType_Worker = val
      this.drawMapV_Worker()
      // this.Data.arrayWorkerData = val
      // this.mapOperationsList[2].num = val.length
    })
    eventBus.$on('mapData_ToiletCar', val => {
      this.Data.arrayToiletCarData = val
      // this.mapOperationsList[3].num = val.length
      // this.drawMapV_ToiletCar()
    })
    eventBus.$on('mapData_ToiletWorker', val => {
      this.Data.arrayToiletWorkerData = val
      // this.mapOperationsList[4].num = val.length
      // this.drawMapV_ToiletWorker()
    })
    eventBus.$on('mapData_Toilet', val => {
      this.Data.arrayToiletData = val
      // this.mapOperationsList[5].num = val.length
      // this.drawMapV_Toilet()
    })
    eventBus.$on('mapData_Toilet_count', val => {
      // this.Data.arrayToiletData = val
      this.mapOperationsList[5].num = val
      // this.drawMapV_Toilet()
    })
    // 双击人员列表某一行，显示标记点，信息窗体
    eventBus.$on('mapDBrowCar', val => {
      this.dbClickToiletCar(val)
    })
    eventBus.$on('mapDBrowRubbish', val => {
      this.dbClickToiletCar(val)
    })
    eventBus.$on('mapDBrowWorker', val => {
      this.dbClickToiletWorker(val)
    })
    eventBus.$on('mapDBrowToilet', val => {
      this.dbClickToilet(val)
    })
    eventBus.$on('mapDBrowToiletCar', val => {
      this.dbClickToiletCar(val)
    })
    eventBus.$on('mapDBrowToiletWorker', val => {
      this.dbClickToiletWorker(val)
    })
    eventBus.$on('onlineStatisticsComprehensive', val => {
      this.realtimeStatistics.comprehensiveOnlineData = val
      this.realtimeStatistics.comprehensiveOnline = val[val.length - 1].在线数量
      this.realtimeStatistics.comprehensiveAll = val[val.length - 1].全部数量
      // this.mapOperationsList[0].num = val[val.length - 1].全部数量
      // this.realtimeStatistics.comprehensiveOnlineData.splice(val.length - 1)
    })
    eventBus.$on('realtimeOnlineStatistics_Vehicle', val => {
      this.realtimeStatistics.vehicleOnlineData = val
      this.realtimeStatistics.vehicleOnline = val[val.length - 1].在线数量
      this.realtimeStatistics.vehicleAll = val[val.length - 1].全部数量
      this.mapOperationsList[0].num = val[val.length - 1].全部数量
      // this.realtimeStatistics.vehicleOnlineData.splice(val.length - 1)
    })
    eventBus.$on('realtimeOnlineStatistics_Rubbish', val => {
      this.realtimeStatistics.rubbishOnlineData = val
      this.realtimeStatistics.rubbishOnline = val[val.length - 1].在线数量
      this.realtimeStatistics.rubbishAll = val[val.length - 1].全部数量
      this.mapOperationsList[1].num = val[val.length - 1].全部数量
      // this.realtimeStatistics.rubbishOnlineData.splice(val.length - 1)
    })
    eventBus.$on('realtimeOnlineStatistics_Worker', val => {
      this.realtimeStatistics.workerOnlineData = val
      this.realtimeStatistics.workerOnline = val[val.length - 1].在线人数
      this.realtimeStatistics.workerAll = val[val.length - 1].全部人数
      this.mapOperationsList[2].num = val[val.length - 1].全部人数
      // this.realtimeStatistics.workerOnlineData.splice(val.length - 1)
    })
    // eventBus.$on('realtimeOnlineStatistics_Worker', val => {
    //   this.realtimeOnlineStatisticsData = val
    //   this.realtimeOnlineStatisticsCount = val[val.length - 1].在线人数
    //   this.realtimeOnlineStatisticsTotal = val[val.length - 1].全部人数
    //   // this.mapOperationsList[0].num = val[val.length - 1].全部数量
    //   this.realtimeOnlineStatisticsData.splice(val.length - 1)
    // })
    eventBus.$on('realtimeOnlineStatistics_WC', val => {
      this.realtimeStatistics.wcWorkerOnline = val[0].在线数量
      this.realtimeStatistics.wcWorkerAll = val[0].全部数量
      this.realtimeStatistics.wcCarOnline = val[1].在线数量
      this.realtimeStatistics.wcCarAll = val[1].全部数量
      this.mapOperationsList[4].num = val[0].全部数量
      this.mapOperationsList[3].num = val[1].全部数量
    })
    // 传输处理三大类点位数据
    eventBus.$once('mapPlacePointZZZ', val => {
      this.mapOperationsList[6].num = val.length
      this.Data.arrayZZZMarkerData = val
    })
    eventBus.$once('mapPlacePointCLC', val => {
      this.mapOperationsList[7].num = val.length
      this.Data.arrayCLCMarkerData = val
    })
    eventBus.$once('mapPlacePointNCD', val => {
      this.mapOperationsList[8].num = val.length
      this.Data.arrayNCDMarkerData = val
    })
    eventBus.$once('mapPlacePointCY', val => {
      this.mapOperationsList[10].num = val.length
      this.Data.arrayCYMarkerData = val
    })
    eventBus.$once('mapPlacePointXQCY', val => {
      this.mapOperationsList[9].num = val.length
      this.Data.arrayXQCYMarkerData = val
    })
    // 传输处理厂区域数据
    eventBus.$once('mapCLCPolygon', val => {
      this.Data.arrayCLCPolygonData = val
      // 创建多边形
      this.handleCheckCLCPolygon()
    })
    // // 清扫队区域
    // eventBus.$on('showClearArea', message => {
    //   // 创建多边形
    //   this.getClearArea(message)
    // })
    // // 清除区域
    // eventBus.$on('clearArea', () => {
    //   this.map.clearOverlays()
    // })
    // // 开始跟踪
    // eventBus.$on('Tracking', val => {
    //   this.dbClick(val)
    // })

    // 隐藏底部列表
    eventBus.$on('toHideFooter', () => {
      this.hideFooter = true;
    })
    // 隐藏左侧面板
    eventBus.$on('toHideMapInfo', () => {
      this.showMapInfo = false;
      this.mapInfoTabValue = '';
    })
    // 隐藏图例
    eventBus.$on('toHideLegend', () => {
      this.showLegend = false;
    })
  },
  mounted () {
    // 显示地图
    this.mapShow()
    this.GetVehicleTree()
  },
  methods: {
    // 显示地图
    async mapShow () {
      // 百度地图API功能
      this.map = newMap();
      // 初始化地图,设置中心点坐标和地图级别
      this.map.centerAndZoom(new BMap.Point(localStorage.getItem('LNG'), localStorage.getItem('LAT')), 16)

      const _this = this

      //缩放屏幕
      this.map.addEventListener('zoomend', function (e) {
        // console.log("地图缩放至：" + this.getZoom() + "级");
        _this.foreachOperationValue()
        // var aa = e.target.getZoom();
        if (e.target.getZoom() > 12 && _this.isZoomChange === 'S') {
          _this.isZoomChange = 'B';
          for (var key in _this.MapV.textLayerVehicle) {
            _this.MapV.textLayerVehicle[key].show();
          }
          for (var key in _this.MapV.textLayerWorker) {
            _this.MapV.textLayerWorker[key].show();
          }
          for (var key in _this.MapV.textLayerRubbish) {
            _this.MapV.textLayerRubbish[key].show();
          }
          for (var key in _this.MapV.textLayerToilet) {
            _this.MapV.textLayerToilet[key].show();
          }
          for (var key in _this.MapV.textLayerToiletCar) {
            _this.MapV.textLayerToiletCar[key].show();
          }
          _this.drawMapV_Vehicle()
          _this.drawMapV_Rubbish()
          _this.drawMapV_Worker()()
          _this.drawMapV_Toilet()
          _this.drawMapV_ToiletCar()
        }
        if (e.target.getZoom() <= 12 && _this.isZoomChange === 'B') {
          _this.isZoomChange = 'S';
          for (var key in _this.MapV.textLayerVehicle) {
            _this.MapV.textLayerVehicle[key].hide();
          }
          for (var key in _this.MapV.textLayerWorker) {
            _this.MapV.textLayerWorker[key].hide();
          }
          for (var key in _this.MapV.textLayerRubbish) {
            _this.MapV.textLayerRubbish[key].hide();
          }
          for (var key in _this.MapV.textLayerToilet) {
            _this.MapV.textLayerToilet[key].hide();
          }
          for (var key in _this.MapV.textLayerToiletCar) {
            _this.MapV.textLayerToiletCar[key].hide();
          }
          _this.drawMapV_Vehicle()
          _this.drawMapV_Rubbish()
          _this.drawMapV_Worker()
          _this.drawMapV_Toilet()
          _this.drawMapV_ToiletCar()
        }
      });
      //拖动屏幕
      this.map.addEventListener('moveend', function (e, target) {
        _this.foreachOperationValue()
      })
    },
    //地图范围改变响应
    mapBoundsEventListener (array) {
      var bounds = this.map.getBounds();   //获取可视区域
      // SouthWest = bounds.getSouthWest(),   //可视区域左下角
      // NorthEast = bounds.getNorthEast();   //可视区域右上角
      // var smlng = bounds.getSouthWest().lng;
      // var smlat = bounds.getSouthWest().lat;
      // var bglng = bounds.getNorthEast().lng;
      // var bglat = bounds.getNorthEast().lat;

      var listhide = [];//隐藏的数据
      var listshow = [];//显示的数据

      array.forEach(element => {
        const point = new BMap.Point(element.LNG, element.LAT)
        if (bounds.containsPoint(point) == true) {
          // if (smlng < element.LNG && element.LNG < bglng && smlat < element.LNG && element.LNG < bglat) {
          listshow.push(element);
        } else {
          listhide.push(element);
        }
      });
      console.log("显示的数据" + listshow.length);
      console.log("隐藏的数据" + listhide.length);

      return listshow
    },
    // 树状结构包括：组织机构和车辆
    async GetVehicleTree () {
      var url = 'Vehicle/GetVehicleTree?ClientNo=' + localStorage.getItem('CLIENT_NO') + '&TypeName=' + '综合'
      const { data } = await this.$Http.get(url)
      if (data.length) {
        countOnAndOff(data)
        this.dataTree = data[0].subs
      }
      function countOnAndOff (data) {
        var online = 0, offline = 0;
        data.forEach(item => {
          if (item.ISONLNE === "1" || item.ISONLNE === "0") {
            if (item.ISONLNE === "1") {
              online++;
            } else {
              offline++;
            }
          } else {
            var arrCount = countOnAndOff(item.subs)
            item.online = arrCount[0]
            item.offline = arrCount[1]
            online += arrCount[0]
            offline += arrCount[1]
          }
        });
        return [online, offline]
      }
    },
    // 画MapV图层
    drawMapV_Vehicle () {
      // 销毁旧图层
      // this.MapV.arrayVIcon_Vehicle.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVText_Vehicle.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVIcon_Vehicle = []
      // this.MapV.arrayVText_Vehicle = []
      for (var key in this.MapV.dataSetDic_Vehicle) {
        this.MapV.dataSetDic_Vehicle[key].set([]);
      }
      //如果关闭车辆显示，结束执行
      if (!this.mapOperationsList[0].active) {
        return
      }
      //因为需要加载不同的图片，所以将车辆数据按车辆类型、是否在线分成不同数组this.Data.arrayForType_Veicle
      this.Data.arrayForType_Veicle.forEach(arrayDataForSameIcon => {
        //如果数据中无数据，退出循环
        if (arrayDataForSameIcon.length == 0) {
          return;
        }

        const _self = this;

        let img = new Image();
        img.src = require('@/assets/img/MapMarker/001/' + arrayDataForSameIcon[0].IMGstr + arrayDataForSameIcon[0].STATUS  + this.isZoomChange + '.png')
        img.onload = function () {
          //循环加载同一张图片的车辆数据
          let arrayImage = arrayDataForSameIcon.map(v => {
            v.geometry = {
              type: 'Point',
              coordinates: [v.LNG, v.LAT]
            }
            v.icon = img;
            v.text = v.LICENSEPLATE;
            return v;
          })

          let key = arrayDataForSameIcon[0].CARTYPE + arrayDataForSameIcon[0].STATUS + this.isZoomChange

          if (_self.MapV.dataSetDic_Vehicle.hasOwnProperty(key)) {

            _self.MapV.dataSetDic_Vehicle[key].set(arrayImage);
            // _self.MapV.iconLayerDic[key].show()
            // _self.MapV.textLayerDic[key].show()

          } else {
            let optionsICON = {
              draw: 'icon',
              width: 45, // 规定图像的宽度
              height: 45, // 规定图像的高度
              // offset: { // 文本便宜值
              //   x: 0,
              //   y: 35
              // }
            }

            let optionsTEXT = {
              draw: 'text',
              size: 14,
              // avoid: true, // 开启文本标注避让
              textBaseline: 'middle',
              offset: { // 文本便宜值
                x: 0,
                y: 20
              }
            }

            let dataSet = new mapv.DataSet(arrayImage);

            _self.MapV.dataSetDic_Vehicle[key] = dataSet;
            new mapv.baiduMapLayer(_self.map, dataSet, optionsICON)
            _self.MapV.textLayerVehicle[key] = new mapv.baiduMapLayer(_self.map, dataSet, optionsTEXT);
            for (var key1 in _self.MapV.textLayerVehicle) {
              _self.MapV.textLayerVehicle[key1].hide();
            }
          }
        }
      });
    },
    drawMapV_Rubbish () {
      // 销毁旧图层
      // this.MapV.arrayVIcon_Rubbish.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVText_Rubbish.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVIcon_Rubbish = []
      // this.MapV.arrayVText_Rubbish = []
      for (var key in this.MapV.dataSetDic_Rubbish) {
        this.MapV.dataSetDic_Rubbish[key].set([]);
      }

      //如果关闭车辆显示，结束执行
      if (!this.mapOperationsList[1].active) {
        return
      }
      //因为需要加载不同的图片，所以将车辆数据按车辆类型、是否在线分成不同数组this.Data.arrayForType_Rubbish
      this.Data.arrayForType_Rubbish.forEach(arrayDataForSameIcon => {
        //如果数据中无数据，退出循环
        if (arrayDataForSameIcon.length == 0) {
          return;
        }

        const _self = this;

        let img = new Image();
        img.src = require('@/assets/img/MapMarker/003/' + arrayDataForSameIcon[0].IMGstr + arrayDataForSameIcon[0].STATUS + this.isZoomChange + '.png')
        img.onload = function () {
          //循环加载同一张图片的车辆数据
          let arrayImage = arrayDataForSameIcon.map(v => {
            v.geometry = {
              type: 'Point',
              coordinates: [v.LNG, v.LAT]
            }
            v.icon = img;
            v.text = v.LICENSEPLATE;
            return v;
          })

          let key = arrayDataForSameIcon[0].CARTYPE + arrayDataForSameIcon[0].STATUS + this.isZoomChange

          if (_self.MapV.dataSetDic_Rubbish.hasOwnProperty(key)) {

            _self.MapV.dataSetDic_Rubbish[key].set(arrayImage);
            // _self.MapV.iconLayerDic[key].show()
            // _self.MapV.textLayerDic[key].show()

          } else {

            let optionsICON = {
              draw: 'icon',
              width: 45, // 规定图像的宽度
              height: 45, // 规定图像的高度
              // offset: { // 文本便宜值
              //   x: 0,
              //   y: 20
              // }
            }

            let optionsTEXT = {
              draw: 'text',
              size: 14,
              // avoid: true, // 开启文本标注避让
              textBaseline: 'middle',
              offset: { // 文本便宜值
                x: 0,
                y: 20
              }
            }

            let dataSet = new mapv.DataSet(arrayImage);

            _self.MapV.dataSetDic_Rubbish[key] = dataSet;
            new mapv.baiduMapLayer(_self.map, dataSet, optionsICON)
            _self.MapV.textLayerRubbish[key] = new mapv.baiduMapLayer(_self.map, dataSet, optionsTEXT);
            for (var key1 in _self.MapV.textLayerRubbish) {
              _self.MapV.textLayerRubbish[key1].hide();
            }
          }
        }
      });
    },
    drawMapV_Worker () {
      // console.log(this.Data.arrw)
      // // 销毁旧图层
      // this.MapV.arrayVIcon_Worker.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVText_Worker.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVIcon_Worker = []
      // this.MapV.arrayVText_Worker = []
      for (var key in this.MapV.dataSetDic_Worker) {
        this.MapV.dataSetDic_Worker[key].set([]);
      }
      //如果关闭车辆显示，结束执行
      if (!this.mapOperationsList[2].active) {
        return
      }
      //因为需要加载不同的图片，所以将车辆数据按车辆类型、是否在线分成不同数组this.Data.arrayForType_Worker
      this.Data.arrayForType_Worker.forEach(arrayDataForSameIcon => {
        //如果数据中无数据，退出循环
        if (arrayDataForSameIcon.length == 0) {
          return;
        }

        const _self = this;

        let img = new Image();
        img.src = require('@/assets/img/MapMarker/002/' + arrayDataForSameIcon[0].WORKTYPE + arrayDataForSameIcon[0].STATUS + this.isZoomChange  + '.png')
        img.onload = function () {
          //循环加载同一张图片的车辆数据
          let arrayImage = arrayDataForSameIcon.map(v => {
            v.geometry = {
              type: 'Point',
              coordinates: [v.LNG, v.LAT]
            }
            v.icon = img;
            v.text = v.NAME;
            return v;
          })

          let key = arrayDataForSameIcon[0].WORKTYPE + arrayDataForSameIcon[0].STATUS + this.isZoomChange

          if (_self.MapV.dataSetDic_Worker.hasOwnProperty(key)) {

            _self.MapV.dataSetDic_Worker[key].set(arrayImage);
            // _self.MapV.iconLayerDic[key].show()
            // _self.MapV.textLayerDic[key].show()

          } else {

            let optionsICON = {
              draw: 'icon',
              width: 40, // 规定图像的宽度
              height: 40, // 规定图像的高度
              // offset: { // 文本便宜值
              //   x: 0,
              //   y: 20
              // }
            }

            let optionsTEXT = {
              draw: 'text',
              size: 14,
              // avoid: true, // 开启文本标注避让
              textBaseline: 'middle',
              offset: { // 文本便宜值
                x: -5,
                y: 25
              }
            }

            let dataSet = new mapv.DataSet(arrayImage);

            _self.MapV.dataSetDic_Worker[key] = dataSet;
            new mapv.baiduMapLayer(_self.map, dataSet, optionsICON)
            _self.MapV.textLayerWorker[key] = new mapv.baiduMapLayer(_self.map, dataSet, optionsTEXT);
            for (var key1 in _self.MapV.textLayerWorker) {
              _self.MapV.textLayerWorker[key1].hide();
            }
          }
        }
      });
    },
    async drawMapVUnmove (arrayPoint, icon, key) {
      // if (this.mapOperationsList[1].active) {
      const _self = this;

      let img = new Image();
      img.src = icon
      img.onload = function () {
        //循环加载同一张图片的车辆数据
        let arrayImage = arrayPoint.map(v => {
          v.geometry = {
            type: 'Point',
            coordinates: [v.LONGITUDE, v.LATITUDE]
          }
          v.icon = img;
          v.text = v.NAME;
          return v;
        })

        let dataSet = new mapv.DataSet(arrayImage);

        let optionsICON = {
          draw: 'icon',
          width: 35, // 规定图像的宽度
          height: 35, // 规定图像的高度
          // offset: { // 文本便宜值
          //       x: 0,
          //       y: 20
          //     }
        }

        let optionsTEXT = {
          draw: 'text',
          size: 14,
          avoid: true, // 开启文本标注避让
          textBaseline: 'middle',
          offset: { // 文本便宜值
            x: 0,
            y: 25
          }
        }
        _self.MapV.VIcon_Installations[key] = new mapv.baiduMapLayer(_self.map, dataSet, optionsICON)
        _self.MapV.VText_Installations[key] = new mapv.baiduMapLayer(_self.map, dataSet, optionsTEXT)
      }
      // }else{
      //   mapVIcon.sh
      // }
    },

    // 显示标记点
    async handleCheckCar () {
      this.MapOverlay.arrayCarMapOverlay.forEach(item => {
        item.enableMassClear()
        this.map.removeOverlay(item)
      })
      this.MapOverlay.arrayCarMapOverlay = []
      if (this.mapOperationsList[0].active) {
        const _self = this;
        var arrayPoint = this.mapBoundsEventListener(this.Data.arrayCarData)
        arrayPoint.forEach(item => {
          var img = ''
          if (item.STATUS == 0) {
            switch (item.CARTYPE) {
              case '机扫车':
                img = imgCarJISAO
                break;
              case '小型机扫车':
                img = imgCarXXJISAO
                break;
              case '吸尘车':
                img = imgCarXICHEN
                break;
              case '洗路车':
                img = imgCarXILU
                break;
              case '洒水车':
                img = imgCarSASHUI
                break;
              case '高压清洗车':
                img = imgCarGYQINGXI
                break;
              case '除雪车':
                img = imgCarCHUXUE
                break;
            }
          } else {
            switch (item.CARTYPE) {
              case '机扫车':
                img = imgCarJISAO0
                break;
              case '小型机扫车':
                img = imgCarXXJISAO0
                break;
              case '吸尘车':
                img = imgCarXICHEN0
                break;
              case '洗路车':
                img = imgCarXILU0
                break;
              case '洒水车':
                img = imgCarSASHUI0
                break;
              case '高压清洗车':
                img = imgCarGYQINGXI0
                break;
              case '除雪车':
                img = imgCarCHUXUE0
                break;
            }
          }
          var marker = this.createMarker(item.LNG, item.LAT, img)
          marker.disableMassClear()
          this.MapOverlay.arrayCarMapOverlay.push(marker)
          var label = new BMap.Label(item.LICENSEPLATE, { offset: new BMap.Size(0, 52) })
          marker.setLabel(label)

          // 信息窗体
          const opts = {
            width: 200,     // 信息窗口宽度
            height: 110,     // 信息窗口高度
            title: '机扫车辆信息', // 信息窗口标题
          }
          const str = `<p style="margin-bottom: 5px;">名称：${item.LICENSEPLATE}</p>
                    <p style="margin-bottom: 5px;">分组：${item.CLIENTNAME}</p>
                    <p style="margin-bottom: 5px;">类型：${item.CARTYPE}</p>
                    `
          const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
          marker.addEventListener("click", function () {
            this.openInfoWindow(infoWindow);
          });
        })
      }
    },
    // 显示标记点
    async handleCheckRubbish () {
      this.MapOverlay.arrayRubbishMapOverlay.forEach(item => {
        item.enableMassClear()
        this.map.removeOverlay(item)
      })
      this.MapOverlay.arrayRubbishMapOverlay = []
      if (this.mapOperationsList[1].active) {
        const _self = this;
        var arrayPoint = this.mapBoundsEventListener(this.Data.arrayRubbishData)
        arrayPoint.forEach(item => {
          var img = ''
          if (item.STATUS == 0) {
            switch (item.CARTYPE) {
              case '小型垃圾车':
                img = imgCarXXLAJI
                break;
              case '挤压车':
                img = imgCarJIYA
                break;
              case '有害垃圾车':
                img = imgCarYHLAJI
                break;
              case '自卸车':
                img = imgCarZIXIE
                break;
              case '勾臂车':
                img = imgCarGOUBI
                break;
              case '餐厨车':
                img = imgCarCANCHU
                break;
              case '吸粪车':
                img = imgCarXIFEN
                break;
            }
          } else {
            switch (item.CARTYPE) {
              case '小型垃圾车':
                img = imgCarXXLAJI0
                break;
              case '挤压车':
                img = imgCarJIYA0
                break;
              case '有害垃圾车':
                img = imgCarYHLAJI0
                break;
              case '自卸车':
                img = imgCarZIXIE0
                break;
              case '勾臂车':
                img = imgCarGOUBI0
                break;
              case '餐厨车':
                img = imgCarCANCHU0
                break;
              case '吸粪车':
                img = imgCarXIFEN0
                break;
            }
          }
          var marker = this.createMarker(item.LNG, item.LAT, img)
          marker.disableMassClear()
          this.MapOverlay.arrayRubbishMapOverlay.push(marker)
          var label = new BMap.Label(item.LICENSEPLATE, { offset: new BMap.Size(0, 52) })
          marker.setLabel(label)

          // 信息窗体
          const opts = {
            width: 200,     // 信息窗口宽度
            height: 110,     // 信息窗口高度
            title: '清运车辆信息', // 信息窗口标题
          }
          const str = `<p style="margin-bottom: 5px;">名称：${item.LICENSEPLATE}</p>
                    <p style="margin-bottom: 5px;">分组：${item.CLIENTNAME}</p>
                    <p style="margin-bottom: 5px;">类型：${item.CARTYPE}</p>
                    `
          const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
          marker.addEventListener("click", function () {
            this.openInfoWindow(infoWindow);
          });
        })
      }
    },
    async handleCheckWorker () {
      this.MapOverlay.arrayWorkerMapOverlay.forEach(item => {
        item.enableMassClear()
        this.map.removeOverlay(item)
      })
      this.MapOverlay.arrayWorkerMapOverlay = []
      if (this.mapOperationsList[2].active) {
        const _self = this;
        var arrayPoint = this.mapBoundsEventListener(this.Data.arrayWorkerData)
        arrayPoint.forEach(item => {
          var img = ''
          if (item.STATUS == 1) {
            switch (item.WORKTYPE) {
              case '班组长':
                img = imgWorkerBZZ
                break;
              case '环卫工':
                img = imgWorkerBJY
                break;
            }
          } else {
            switch (item.WORKTYPE) {
              case '班组长':
                img = imgWorkerBZZ0
                break;
              case '环卫工':
                img = imgWorkerBJY0
                break;
            }
          }

          var marker = this.createMarker(item.LNG, item.LAT, img)
          marker.disableMassClear()
          this.MapOverlay.arrayWorkerMapOverlay.push(marker)
          var label = new BMap.Label(item.NAME, { offset: new BMap.Size(0, 52) })
          marker.setLabel(label)

          // 信息窗体
          const opts = {
            width: 200,     // 信息窗口宽度
            height: 90,     // 信息窗口高度
            title: '维保工人', // 信息窗口标题
          }
          const str = `<p style="margin-bottom: 5px;">名称：${item.NAME}</p>
                    <p style="margin-bottom: 5px;">分组：${item.CLIENTNAME}</p>
                    <p style="margin-bottom: 5px;">类型：${item.WORKTYPE}</p>
                    `
          const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
          marker.addEventListener("click", function () {
            this.openInfoWindow(infoWindow);
          });
        })
      }
    },
    async handleCheckToiletCar () {
      this.MapOverlay.arrayToiletCarMapOverlay.forEach(item => {
        item.enableMassClear()
        this.map.removeOverlay(item)
      })
      this.MapOverlay.arrayToiletCarMapOverlay = []
      if (this.mapOperationsList[3].active) {
        const _self = this;
        var arrayPoint = this.mapBoundsEventListener(this.Data.arrayToiletCarData)
        arrayPoint.forEach(item => {
          var img = ''
          if (item.STATUS == 0) {
            img = imgCarXIFEN0
          } else {
            img = imgCarXIFEN
          }
          var marker = this.createMarker(item.LNG, item.LAT, img)
          marker.disableMassClear()
          this.MapOverlay.arrayToiletCarMapOverlay.push(marker)
          var label = new BMap.Label(item.LICENSEPLATE, { offset: new BMap.Size(0, 52) })
          marker.setLabel(label)

          // 信息窗体
          const opts = {
            width: 200,     // 信息窗口宽度
            height: 110,     // 信息窗口高度
            title: '吸粪车辆信息', // 信息窗口标题
          }
          const str = `<p style="margin-bottom: 5px;">名称：${item.LICENSEPLATE}</p>
                    <p style="margin-bottom: 5px;">分组：${item.CLIENTNAME}</p>
                    <p style="margin-bottom: 5px;">类型：${item.CARTYPE}</p>
                    `
          const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
          marker.addEventListener("click", function () {
            this.openInfoWindow(infoWindow);
          });
        })
      }
    },
    async handleCheckToiletWorker () {
      this.MapOverlay.arrayToiletWorkerMapOverlay.forEach(item => {
        item.enableMassClear()
        this.map.removeOverlay(item)
      })
      this.MapOverlay.arrayToiletWorkerMapOverlay = []
      if (this.mapOperationsList[4].active) {
        const _self = this;
        var arrayPoint = this.mapBoundsEventListener(this.Data.arrayToiletWorkerData)
        arrayPoint.forEach(item => {
          var img = ''
          if (item.STATUS == 0) {
            img = imgToiletWorkerLD0
          } else {
            img = imgToiletWorkerLD
          }
          var marker = this.createMarker(item.LNG, item.LAT, img)
          marker.disableMassClear()
          this.MapOverlay.arrayToiletWorkerMapOverlay.push(marker)
          var label = new BMap.Label(item.NAME, { offset: new BMap.Size(0, 52) })
          marker.setLabel(label)

          // 信息窗体
          const opts = {
            width: 200,     // 信息窗口宽度
            height: 90,     // 信息窗口高度
            title: '维保工人', // 信息窗口标题
          }
          const str = `<p style="margin-bottom: 5px;">名称：${item.NAME}</p>
                    <p style="margin-bottom: 5px;">分组：${item.CLIENTNAME}</p>
                    <p style="margin-bottom: 5px;">类型：${item.WORKTYPE}</p>
                    `
          const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
          marker.addEventListener("click", function () {
            this.openInfoWindow(infoWindow);
          });
        })
      }
    },
    async handleCheckToilet () {
      this.MapOverlay.arrayToiletMapOverlay.forEach(item => {
        item.enableMassClear()
        this.map.removeOverlay(item)
      })
      this.MapOverlay.arrayToiletMapOverlay = []
      if (this.mapOperationsList[5].active) {
        const _self = this;
        var arrayPoint = this.mapBoundsEventListener(this.Data.arrayToiletData)
        arrayPoint.forEach(item => {
          var img = imgToiletDMDX
          switch (item.TYPE) {
            case '独立式公厕':
              img = imgToiletDL
              break;
            case '附建式公厕':
              img = imgToiletFJ
              break;
            case '移动式公厕':
              img = imgToiletYD
              break;
          }
          var marker = this.createMarker(item.LNG, item.LAT, img)
          marker.disableMassClear()
          this.MapOverlay.arrayToiletMapOverlay.push(marker)
          var label = new BMap.Label(item.NAME, { offset: new BMap.Size(0, 52) })
          marker.setLabel(label)

          // 信息窗体
          const opts = {
            width: 200,     // 信息窗口宽度
            height: 110,     // 信息窗口高度
            title: '公厕信息', // 信息窗口标题
          }
          const str = `<p style="margin-bottom: 5px;">名称：${item.NAME}</p>
          <p style="margin-bottom: 5px;">等级：${item.LEVEL}</p>
                    <p style="margin-bottom: 5px;">类型：${item.TYPE}</p>
                    <p style="margin-bottom: 5px;">位置：${item.LOCATION}</p>
                    `
          const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
          marker.addEventListener("click", function () {
            this.openInfoWindow(infoWindow);
          });
        })
      }
    },
    drawMapV_ToiletCar () {
      for (var key in this.MapV.dataSetDic_ToiletCar) {
        this.MapV.dataSetDic_ToiletCar[key].set([]);
      }
      //如果关闭车辆显示，结束执行
      if (!this.mapOperationsList[3].active) {
        return
      }
      //因为需要加载不同的图片，所以将车辆数据按车辆类型、是否在线分成不同数组this.Data.arrayForType_Worker
      this.Data.arrayToiletCarData.forEach(arrayDataForSameIcon => {
        //如果数据中无数据，退出循环
        if (arrayDataForSameIcon.length == 0) {
          return;
        }

        const _self = this;

        let img = new Image();
        img.src = require('@/assets/img/MapMarker/rubbishCar/' + arrayDataForSameIcon[0].img + this.isZoomChange + '.png')
        img.onload = function () {
          //循环加载同一张图片的车辆数据
          let arrayImage = arrayDataForSameIcon.map(v => {
            v.geometry = {
              type: 'Point',
              coordinates: [v.LNG, v.LAT]
            }
            v.icon = img;
            v.text = v.LICENSEPLATE;
            return v;
          })

          let key = arrayDataForSameIcon[0].img

          if (_self.MapV.dataSetDic_ToiletCar.hasOwnProperty(key)) {

            _self.MapV.dataSetDic_ToiletCar[key].set(arrayImage);
            // _self.MapV.iconLayerDic[key].show()
            // _self.MapV.textLayerDic[key].show()

          } else {

            let optionsICON = {
              draw: 'icon',
              width: 45, // 规定图像的宽度
              height: 45, // 规定图像的高度
              // offset: { // 文本便宜值
              //   x: 0,
              //   y: 20
              // }
            }

            let optionsTEXT = {
              draw: 'text',
              size: 14,
              // avoid: true, // 开启文本标注避让
              textBaseline: 'middle',
              offset: { // 文本便宜值
                x: 0,
                y: 30
              }
            }

            let dataSet = new mapv.DataSet(arrayImage);

            _self.MapV.dataSetDic_ToiletCar[key] = dataSet;
            new mapv.baiduMapLayer(_self.map, dataSet, optionsICON)
            _self.MapV.textLayerToiletCar[key] = new mapv.baiduMapLayer(_self.map, dataSet, optionsTEXT)
            for (var key1 in _self.MapV.textLayerToiletCar) {
              _self.MapV.textLayerToiletCar[key1].hide();
            }
          }
        }
      });
    },
    drawMapV_ToiletWorker () {
      // console.log(this.Data.arrw)
      // // 销毁旧图层
      // this.MapV.arrayVIcon_Worker.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVText_Worker.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVIcon_Worker = []
      // this.MapV.arrayVText_Worker = []
      for (var key in this.MapV.dataSetDic_ToiletWorker) {
        this.MapV.dataSetDic_ToiletWorker[key].set([]);
      }
      //如果关闭车辆显示，结束执行
      if (!this.mapOperationsList[4].active) {
        return
      }
      //因为需要加载不同的图片，所以将车辆数据按车辆类型、是否在线分成不同数组this.Data.arrayForType_Worker
      this.Data.arrayToiletWorkerData.forEach(arrayDataForSameIcon => {
        //如果数据中无数据，退出循环
        if (arrayDataForSameIcon.length == 0) {
          return;
        }

        const _self = this;

        let img = new Image();
        img.src = require('@/assets/img/MapMarker/wcWorker/' + arrayDataForSameIcon[0].img + '.png')
        img.onload = function () {
          //循环加载同一张图片的车辆数据
          let arrayImage = arrayDataForSameIcon.map(v => {
            v.geometry = {
              type: 'Point',
              coordinates: [v.LNG, v.LAT]
            }
            v.icon = img;
            v.text = v.NAME;
            return v;
          })

          let key = arrayDataForSameIcon[0].img

          if (_self.MapV.dataSetDic_ToiletWorker.hasOwnProperty(key)) {

            _self.MapV.dataSetDic_ToiletWorker[key].set(arrayImage);
            // _self.MapV.iconLayerDic[key].show()
            // _self.MapV.textLayerDic[key].show()

          } else {

            let optionsICON = {
              draw: 'icon',
              width: 40, // 规定图像的宽度
              height: 40, // 规定图像的高度
              // offset: { // 文本便宜值
              //   x: 0,
              //   y: 20
              // }
            }

            let optionsTEXT = {
              draw: 'text',
              size: 14,
              // avoid: true, // 开启文本标注避让
              textBaseline: 'middle',
              offset: { // 文本便宜值
                x: 0,
                y: 30
              }
            }

            let dataSet = new mapv.DataSet(arrayImage);

            _self.MapV.dataSetDic_ToiletWorker[key] = dataSet;
            new mapv.baiduMapLayer(_self.map, dataSet, optionsICON)
            new mapv.baiduMapLayer(_self.map, dataSet, optionsTEXT)
          }
        }
      });
    },
    drawMapV_Toilet () {
      // 销毁旧图层
      // this.MapV.arrayVIcon.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVText.forEach(element => {
      //   element.destroy();
      //   element = {}
      // });
      // this.MapV.arrayVIcon = []
      // this.MapV.arrayVText = []
      for (var key in this.MapV.dataSetDic_Toilet) {
        this.MapV.dataSetDic_Toilet[key].set([]);
      }

      //如果关闭车辆显示，结束执行
      if (!this.mapOperationsList[5].active) {
        return
      }
      //因为需要加载不同的图片，所以将车辆数据按车辆类型、是否在线分成不同数组this.Data.arrayForType
      this.Data.arrayToiletData.forEach(arrayDataForSameIcon => {
        //如果数据中无数据，退出循环
        if (arrayDataForSameIcon.length == 0) {
          return;
        }

        const _self = this;

        let img = new Image();
        img.src = require('@/assets/img/MapMarker/wcToilet/' + arrayDataForSameIcon[0].img + this.isZoomChange + '.png')
        img.onload = function () {
          //循环加载同一张图片的车辆数据
          let arrayImage = arrayDataForSameIcon.map(v => {
            v.geometry = {
              type: 'Point',
              coordinates: [v.LNG, v.LAT]
            }
            v.icon = img;
            v.text = v.NAME;
            return v;
          })

          let key = arrayDataForSameIcon[0].TYPE

          if (_self.MapV.dataSetDic_Toilet.hasOwnProperty(key)) {

            _self.MapV.dataSetDic_Toilet[key].set(arrayImage);
            // _self.MapV.iconLayerDic[key].show()
            // _self.MapV.textLayerDic[key].show()

          } else {

            let optionsICON = {
              draw: 'icon',
              width: 35, // 规定图像的宽度
              height: 35, // 规定图像的高度
              // offset: { // 文本便宜值
              //   x: 0,
              //   y: 20
              // }
            }

            let optionsTEXT = {
              draw: 'text',
              size: 14,
              avoid: true, // 开启文本标注避让
              textBaseline: 'middle',
              offset: { // 文本便宜值
                x: 0,
                y: 30
              }
            }

            let dataSet = new mapv.DataSet(arrayImage);

            _self.MapV.dataSetDic_Toilet[key] = dataSet;
            new mapv.baiduMapLayer(_self.map, dataSet, optionsICON)
            _self.MapV.textLayerToilet[key] = new mapv.baiduMapLayer(_self.map, dataSet, optionsTEXT)
            for (var key1 in _self.MapV.textLayerToilet) {
              _self.MapV.textLayerToilet[key1].hide();
            }
          }
        }
      });
    },
    // 跳转至多辆车视频页面
    goMoreCarVideo () {
      // 暂时写死车牌号
      const LICENSEPLATE = '津C95726';
      this.MouseEvent.isShow = false;
      this.$router.push({
        path: '/moreCarVideo',
        query: {
          LICENSEPLATE
        }
      });
    },
    // 创建标记点
    createMarker (lng, lat, iconURL) {
      const pt = new BMap.Point(lng, lat)
      const myIcon = new BMap.Icon(iconURL, new BMap.Size(65, 65))
      const marker = new BMap.Marker(pt, { icon: myIcon })// 创建标注
      this.map.addOverlay(marker)// 将标注添加到地图中
      return marker
    },
    // 双击人员列表
    dbClickToiletCar (val) {
      // 标记点地图居中
      // this.map.centerAndZoom(new BMap.Point(val.LNG, val.LAT), this.mapZoom)
      setCenterOffset(this.map, new BMap.Point(val.LNG, val.LAT), this.mapZoom)
      // 信息窗体
      const opts = {
        width: 200,     // 信息窗口宽度
        height: 110,     // 信息窗口高度
        title: '车辆信息', // 信息窗口标题
      }
      const str = `<p style="margin-top: 5px;margin-bottom: 5px;">车辆名称：${val.LICENSEPLATE}</p>
      <p style="margin-bottom: 5px;">分组：${val.CLIENTNAME}</p>
      <p style="margin-bottom: 5px;">车辆类型：${val.CARTYPE}</p>
      `
      const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
      const point = new BMap.Point(val.LNG, val.LAT)//信息窗体坐标
      this.map.openInfoWindow(infoWindow, point) //开启信息窗口
    },
    dbClickToiletWorker (val) {
      // 标记点地图居中
      // this.map.centerAndZoom(new BMap.Point(val.LNG, val.LAT), this.mapZoom)
      setCenterOffset(this.map, new BMap.Point(val.LNG, val.LAT), this.mapZoom)
      // 信息窗体
      const opts = {
        width: 200,     // 信息窗口宽度
        height: 90,     // 信息窗口高度
        title: '维保工人', // 信息窗口标题
      }
      const str = `<p style="margin-bottom: 5px;">名称：${val.NAME}</p>
                <p style="margin-bottom: 5px;">分组：${val.CLIENTNAME}</p>
                <p style="margin-bottom: 5px;">类型：${val.WORKTYPE}</p>
                `
      const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
      const point = new BMap.Point(val.LNG, val.LAT)//信息窗体坐标
      this.map.openInfoWindow(infoWindow, point) //开启信息窗口
    },
    dbClickToilet (val) {
      // 标记点地图居中
      // this.map.centerAndZoom(new BMap.Point(val.LNG, val.LAT), this.mapZoom)
      setCenterOffset(this.map, new BMap.Point(val.LNG, val.LAT), this.mapZoom)
      // 信息窗体
      const opts = {
        width: 200,     // 信息窗口宽度
        height: 110,     // 信息窗口高度
        title: '公厕信息', // 信息窗口标题
      }
      const str = `<p style="margin-bottom: 5px;">名称：${val.NAME}</p>
      <p style="margin-bottom: 5px;">等级：${val.LEVEL}</p>
                <p style="margin-bottom: 5px;">类型：${val.TYPE}</p>
                <p style="margin-bottom: 5px;">位置：${val.LOCATION}</p>
                `
      const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
      const point = new BMap.Point(val.LNG, val.LAT)//信息窗体坐标
      this.map.openInfoWindow(infoWindow, point) //开启信息窗口
    },
    async handleCheckZZZ () {
      let key = 'ZZZ'
      var vIcon = this.MapV.VIcon_Installations[key]
      var vText = this.MapV.VText_Installations[key]
      if (this.mapOperationsList[6].active) {
        if (vIcon) {
          vIcon.show()
          vText.show()
        } else {
          this.drawMapVUnmove(this.Data.arrayZZZMarkerData, imgMarkerZZZ, key)

        }
      } else {
        vIcon.hide()
        vText.hide()
      }
    },
    async handleCheckZZZ1 () {
      if (this.mapOperationsList[6].active) {
        this.Data.arrayZZZMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerZZZ, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.NAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayZZZMapOverlay.push(marker)
        })
      } else {
        for (var i = 0; i < this.MapOverlay.arrayZZZMapOverlay.length; i++) {
          this.MapOverlay.arrayZZZMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayZZZMapOverlay[i])
        }
        this.MapOverlay.arrayZZZMapOverlay = []
      }
    },
    async handleCheckCLC () {
      let key = 'CLC'
      var vIcon = this.MapV.VIcon_Installations[key]
      var vText = this.MapV.VText_Installations[key]
      if (this.mapOperationsList[7].active) {
        if (vIcon) {
          vIcon.show()
          vText.show()
        } else {
          this.drawMapVUnmove(this.Data.arrayCLCMarkerData, imgMarkerCLC, key)

        }
      } else {
        vIcon.hide()
        vText.hide()
      }
    },
    async handleCheckCLC1 () {
      if (this.mapOperationsList[7].active) {
        this.Data.arrayCLCMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerCLC, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.NAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayCLCMapOverlay.push(marker)
        });
      } else {
        for (var i = 0; i < this.MapOverlay.arrayCLCMapOverlay.length; i++) {
          this.MapOverlay.arrayCLCMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayCLCMapOverlay[i])
        }
        this.MapOverlay.arrayCLCMapOverlay = []
      }
    },
    async handleCheckNCD () {
      let key = 'NCD'
      var vIcon = this.MapV.VIcon_Installations[key]
      var vText = this.MapV.VText_Installations[key]
      if (this.mapOperationsList[8].active) {
        if (vIcon) {
          vIcon.show()
          vText.show()
        } else {
          this.drawMapVUnmove(this.Data.arrayNCDMarkerData, imgMarkerNCD, key)

        }
      } else {
        vIcon.hide()
        vText.hide()
      }
    },
    async handleCheckNCD1 () {
      if (this.mapOperationsList[8].active) {
        this.Data.arrayNCDMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerNCD, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.POINTNAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayNCDMapOverlay.push(marker)
        });
      } else {
        for (var i = 0; i < this.MapOverlay.arrayNCDMapOverlay.length; i++) {
          this.MapOverlay.arrayNCDMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayNCDMapOverlay[i])
        }
        this.MapOverlay.arrayNCDMapOverlay = []
      }
    },
    async handleCheckCY () {
      let key = 'CY'
      var vIcon = this.MapV.VIcon_Installations[key]
      var vText = this.MapV.VText_Installations[key]
      if (this.mapOperationsList[10].active) {
        if (vIcon) {
          vIcon.show()
          vText.show()
        } else {
          this.drawMapVUnmove(this.Data.arrayCYMarkerData, imgMarkerCY, key)

        }
      } else {
        vIcon.hide()
        vText.hide()
      }
    },
    async handleCheckCY1 () {
      if (this.mapOperationsList[10].active) {
        this.Data.arrayCYMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerCY, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.POINTNAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayCYMapOverlay.push(marker)
        });
      } else {
        for (var i = 0; i < this.MapOverlay.arrayCYMapOverlay.length; i++) {
          this.MapOverlay.arrayCYMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayCYMapOverlay[i])
        }
        this.MapOverlay.arrayCYMapOverlay = []
      }
    },
    // //小区
    async handleCheckXQCY () {
      let key = 'XQCY'
      var vIcon = this.MapV.VIcon_Installations[key]
      var vText = this.MapV.VText_Installations[key]
      if (this.mapOperationsList[9].active) {
        if (vIcon) {
          vIcon.show()
          vText.show()
        } else {
          this.drawMapVUnmove(this.Data.arrayXQCYMarkerData, imgMarkerXQCY, key)

        }
      } else {
        vIcon.hide()
        vText.hide()
      }
    },
    async handleCheckXQCY1 () {
      if (this.mapOperationsList[9].active) {
        this.Data.arrayXQCYMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerXQCY, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.POINTNAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayXQCYMapOverlay.push(marker)
        });
      } else {
        for (var i = 0; i < this.MapOverlay.arrayXQCYMapOverlay.length; i++) {
          this.MapOverlay.arrayXQCYMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayXQCYMapOverlay[i])
        }
        this.MapOverlay.arrayXQCYMapOverlay = []
      }
    },
    async handleCheckCLCPolygon () {
      // if (document.getElementById('checkbox_clc').checked) {
      var pointPolygon = []
      this.Data.arrayCLCPolygonData.forEach(item => {
        var point = new BMap.Point(item.经度, item.纬度)
        pointPolygon.push(point)
      })
      // var polygon = new BMap.Polygon([new BMap.Point(117.425438, 38.872788), new BMap.Point(117.426718, 38.873610), new BMap.Point(117.427381, 38.872967), new BMap.Point(117.426111, 38.872155), new BMap.Point(117.425438, 38.872788)], { strokeColor: 'blue', strokeWeight: 2, strokeOpacity: 0.5 })
      var polygon = new BMap.Polygon(pointPolygon)
      polygon.disableMassClear()
      this.map.addOverlay(polygon)
      this.MapOverlay.arrayCLCMapOverlay.push(polygon)
      // var polygonCenter = polygon.getBounds().getCenter()
      // var markerImage = new BMap.Icon(imgMarkerCLC, new BMap.Size(50, 50))
      // var marker = new BMap.Marker(polygonCenter, { icon: markerImage })
      // marker.disableMassClear()
      // var label = new BMap.Label('滨海新区碧海环保垃圾处理厂', { offset: new BMap.Size(-10, 50) })
      // marker.setLabel(label)
      // this.map.addOverlay(marker)
      // this.MapOverlay.arrayCLCMapOverlay.push(marker)
      // this.map.centerAndZoom(polygonCenter, this.mapZoom)
      // } else {
      //   this.MapOverlay.arrayCLCMapOverlay.forEach(item => {
      //     item.enableMassClear()
      //     this.map.removeOverlay(item)
      //   })
      //   this.MapOverlay.arrayCLCMapOverlay = []
      // }
    },
    // 显示底部列表
    showFooter () {
      this.hideFooter = false;
      eventBus.$emit('toShowFooter');
    },
    // 仅显示头
    onlyShowHeader () {
      // this.toHideWarningInfo();
      eventBus.$emit('toHideMapInfo');
      eventBus.$emit('toHideFooter');
      eventBus.$emit('toHideLegend');
    },
    // 进入全屏
    requestFullScreen () {
      this.isFull = true;
      eventBus.$emit('contentToFullScreen');
      var de = document.documentElement;
      if (de.requestFullscreen) {
        de.requestFullscreen();
      } else if (de.mozRequestFullScreen) {
        de.mozRequestFullScreen();
      } else if (de.webkitRequestFullScreen) {
        de.webkitRequestFullScreen();
      }
    },
    batchOperate (command) {
      switch (command) {
        case "batch_remarks":
          this.setMeasureArea();

          break;

        case "export_excel":
          this.setDistance();
          break;

        case "findcar":
          this.setDrawingManager();
          break;
        case "findcarc":
          this.setDrawingrectangleManager();
          break;
        case "photo":
          this.savepic();
          break;
          case "wx":
          this.setMapTypeWX();
          break;
          case "pt":
          this.setMapTypePT();
          break;

      }
    },
        //////////地图样式切换为卫星地图
    setMapTypeWX() {
      this.isMapWX = true
      this.map.setMapType(BMAP_SATELLITE_MAP);
    },
    //////////地图样式切换为普通地图
    setMapTypePT() {
      this.isMapWX = false
      this.map.setMapType(BMAP_NORMAL_MAP);
    },

    //截屏保存成图片
    async savepic () {
      let canvas = document.querySelector(".savemap");
      let that = this;
      html2canvas(canvas, {
        useCORS: true,
        tainttest: true,
        allowTaint: true,
        width: window.screen.availWidth,
        height: window.screen.availHeight,
      }).then(function (canvas) {
        let type = "png";
        let imgData = canvas.toDataURL(type);
        // 照片格式处理
        let _fixType = function (type) {
          type = type.toLowerCase().replace(/jpg/i, "jpeg");
          let r = type.match(/png|jpeg|bmp|gif/)[0];
          return "image/" + r;
        };
        imgData = imgData.replace(_fixType(type), "image/octet-stream");
        let filename = "垃圾收运图片" + "." + type;
        that.saveFile(imgData, filename);
      });
    },
    saveFile (data, filename) {
      let save_link = document.createElementNS(
        "http://www.w3.org/1999/xhtml",
        "a"
      );
      save_link.href = data;
      save_link.download = filename;

      let event = document.createEvent("MouseEvents");
      event.initMouseEvent(
        "click",
        true,
        false,
        window,
        0,
        0,
        0,
        0,
        0,
        false,
        false,
        false,
        false,
        0,
        null
      );
      save_link.dispatchEvent(event);
    },
    // 测距
    setDistance () {
      if (!this.mapCursor) {
        this.mapCursor = new BMapLib.DistanceTool(this.map);
      }
      if (this.mapCursor.isOpen) {
        // 结束测量
        this.mapCursor.close();
      } else {
        // 开始测量
        this.mapCursor.open();
      }
    },
    // 测算面积
    setMeasureArea () {
      // 实例化绘图工具
      var mapDrawingPolygon = new BMapLib.DrawingManager(this.map, {
        // enableDrawingTool: true,//工具栏
        drawingToolOptions: {
          anchor: BMAP_ANCHOR_TOP_RIGHT,
          offset: new BMap.Size(5, 5),
        },
        polygonOptions: {
          strokeColor: "red", // 边线颜色。
          strokeWeight: 1.5, // 边线的宽度，以像素为单位。
        },
      });

      // 设置绘制模式为绘制多边形
      mapDrawingPolygon.setDrawingMode("polygon");

      const _this = this;
      // // 监听绘制结果
      mapDrawingPolygon.addEventListener(
        "polygoncomplete",
        function (e, overlay) {
          //关闭按钮
          var m = new BMap.Icon(closeBtnImg, new BMap.Size(40, 40));
          var closeBtn = new BMap.Marker(overlay.getBounds().getNorthEast(), {
            icon: m,
            offset: new BMap.Size(30, 15),
          });
          _this.map.addOverlay(closeBtn);

          //计算多边形的面积
          var _area = 0;
          _area = BMapLib.GeoUtils.getPolygonArea(overlay);
          //保留两位小数
          _area = _area.toFixed(2);
          //获取多边形的中心
          var _paths = overlay.getPath();
          var point = getCenterPoint(_paths);
          //往多边形添加标注
          var label = new BMap.Label("区域面积：" + _area + "平方米", null);
          label.setPosition(point);
          label.setOffset(new BMap.Size(-80, 0));
          //往地图上添加标注
          _this.map.addOverlay(label);

          closeBtn.addEventListener("click", function (r) {
            _this.map.removeOverlay(label);
            _this.map.removeOverlay(overlay);
            _this.map.removeOverlay(this);
          });
        }
      );
      mapDrawingPolygon.open();
    },
    //////////范围查车
    setDrawingManager () {
      this.planID = 0;
      // 电子围栏 初始化
      if (!this.mapDrawingManager) {
        // 实例化绘图工具
        this.mapDrawingManager = new BMapLib.DrawingManager(this.map, {
          // enableDrawingTool: true,//工具栏
          drawingToolOptions: {
            anchor: BMAP_ANCHOR_TOP_RIGHT,
            offset: new BMap.Size(5, 5),
          },
        });
        const _this = this;
        // 监听绘制结果
        this.mapDrawingManager.addEventListener(
          "polygoncomplete",
          function (e, overlay) {
            // this.mapDrawingManager.addEventListener('overlaycomplete', res => {

            overlay.addEventListener(
              "click",
              function (type, target, point, pixel) {
                this.ID = null;
                _this.editOverlay(this);
              }
            );
            overlay.ID = null;
            _this.editOverlay(overlay);
          }
        );
        this.mapDrawingManager.setDrawingMode("polygon");
      }
      if (this.mapDrawingManager.isOpen) {
        // 结束画图
        this.mapDrawingManager.close();
      } else {
        // 开始画图
        this.mapDrawingManager.open();
      }
      // 开始画图
      // this.mapDrawingManager.open()
    },
    // 编辑多边形
    editOverlay (overlay) {
      overlay.type = "draw";
      overlay.enableEditing(); // 设置电子围栏可编辑
      var m = new BMap.Icon(closeBtnImg, new BMap.Size(40, 40));
      var closeBtn = new BMap.Marker(overlay.getBounds().getNorthEast(), {
        icon: m,
        offset: new BMap.Size(0, -15),
      });
      this.map.addOverlay(closeBtn);
      // closeBtn.setTitle("\u6e05\u9664\u672c\u6b21\u6d4b\u8ddd");
      const _this = this;
      closeBtn.addEventListener("click", function (r) {
        overlay.disableEditing();
        _this.isPointInPolygon(overlay);
        _this.map.removeOverlay(this);
        _this.map.removeOverlay(overlay);
      });
    },

    setDrawingrectangleManager () {
      this.planID = 0;
      // 电子围栏 初始化
      if (!this.mapDrawingrectangleManager) {
        // 实例化绘图工具
        this.mapDrawingrectangleManager = new BMapLib.DrawingManager(this.map, {
          // enableDrawingTool: true,//工具栏
          drawingToolOptions: {
            anchor: BMAP_ANCHOR_TOP_RIGHT,
            offset: new BMap.Size(5, 5),
          },
        });
        const _this = this;
        // 监听绘制结果
        this.mapDrawingrectangleManager.addEventListener(
          "rectanglecomplete",
          function (e, overlay) {
            // this.mapDrawingManager.addEventListener('overlaycomplete', res => {
            _this.mapDrawingrectangleManager.close();
            overlay.addEventListener(
              "click",
              function (type, target, point, pixel) {
                this.ID = null;
                _this.editrectangleOverlay(this);
              }
            );
            overlay.ID = null;
            _this.editrectangleOverlay(overlay);
          }
        );
        this.mapDrawingrectangleManager.setDrawingMode("rectangle");
      }
      if (this.mapDrawingrectangleManager.isOpen) {
        // 结束画图
        this.mapDrawingrectangleManager.close();
      } else {
        // 开始画图
        this.mapDrawingrectangleManager.open();
      }
      // 开始画图
      // this.mapDrawingManager.open()
    },
    // 编辑多边形
    editrectangleOverlay (overlay) {
      overlay.type = "draw";
      overlay.enableEditing(); // 设置电子围栏可编辑
      var m = new BMap.Icon(closeBtnImg, new BMap.Size(40, 40));
      var closeBtn = new BMap.Marker(overlay.getBounds().getNorthEast(), {
        icon: m,
        offset: new BMap.Size(0, -15),
      });
      this.map.addOverlay(closeBtn);
      // closeBtn.setTitle("\u6e05\u9664\u672c\u6b21\u6d4b\u8ddd");
      const _this = this;
      closeBtn.addEventListener("click", function (r) {
        overlay.disableEditing();
        _this.isPointInPolygon(overlay);
        _this.map.removeOverlay(this);
        _this.map.removeOverlay(overlay);
      });
    },

    isPointInPolygon (overlay) {
      this.arrPointIn = [];
      for (var i = 0; i < this.Data.arrayForType_Rubbish.length; i++) {
        for (var j = 0; j < this.Data.arrayForType_Rubbish[i].length; j++) {
          // console.log(this.Data.arrayForType_Veicle);
          var result = BMapLib.GeoUtils.isPointInPolygon(
            new BMap.Point(
              this.Data.arrayForType_Rubbish[i][j].LNG,
              this.Data.arrayForType_Rubbish[i][j].LAT
            ),
            overlay
          );
          if (result) {
            console.log(this.Data.arrayForType_Rubbish[i][j]);
            this.arrPointIn.push(this.Data.arrayForType_Rubbish[i][j]);
          }
        }
      }
      this.titleDialogRange = "查车结果：" + this.arrPointIn.length + "辆";
      // alert("范围内车辆数" + this.arrPointIn.length);
      // if (this.arrPointIn.length > 0) {
      this.isShowDialogRange = true;
      // }
    },
    // 退出全屏
    exitFullscreen () {
      this.isFull = false;
      eventBus.$emit('contentToDefaultScreen');
      var de = document;
      if (de.exitFullscreen) {
        de.exitFullscreen();
      } else if (de.mozCancelFullScreen) {
        de.mozCancelFullScreen();
      } else if (de.webkitCancelFullScreen) {
        de.webkitCancelFullScreen();
      }
    },
    // 地图信息tab切换
    changeMapInfoTabValue (index) {
      if ((index === this.mapInfoTabValue) && this.showMapInfo) {
        this.showMapInfo = false;
        this.mapInfoTabValue = '';
      } else {
        this.showMapInfo = true;
        this.mapInfoTabValue = index;
      }
    },
    // 改变右上方显示隐藏图标
    changeOperationSummary (item, index) {
      item.active = !item.active

      switch (index) {
        case 0:
          this.changeOperationValue(this.mapOperationsList[0], 0)
          break;
        case 1:
          this.changeOperationValue(this.mapOperationsList[1], 1)
          break;
        case 2:
          this.changeOperationValue(this.mapOperationsList[2], 2)
          break;
        case 3:
          this.changeOperationValue(this.mapOperationsList[3], 3)
          break;
        case 4:
          this.changeOperationValue(this.mapOperationsList[4], 4)
          break;
        case 5: {
          this.mapOperationsList[5].active = item.active
          this.mapOperationsList[6].active = item.active
          this.mapOperationsList[7].active = item.active
          this.mapOperationsList[8].active = item.active
          this.mapOperationsList[9].active = item.active
          this.mapOperationsList[10].active = item.active
          this.drawMapV_Toilet()
          this.handleCheckZZZ()
          this.handleCheckCLC()
          this.handleCheckNCD()
          this.handleCheckXQCY()
          this.handleCheckCY()
          break;
        }
        default:
          break;
      }
    },
    foreachOperationValue () {
      this.mapOperationsList.forEach(element => {
        if (element.active) {
          switch (element.name) {
            case '机扫车辆':
              this.drawMapV_Vehicle()
              break;
            case '清运车辆':
              this.drawMapV_Rubbish()
              break;
            case '人工保洁':
              this.drawMapV_Worker()
              break;
            case '吸粪车辆':
              this.drawMapV_ToiletCar()
              break;
            case '维保人员':
              this.drawMapV_ToiletWorker()
              break;
            case '公厕':
              this.drawMapV_Toilet()
              break;
            case '转运站':
              this.handleCheckZZZ()
              break;
            case '处理厂':
              this.handleCheckCLC()
              break;
            case '农村垃圾点':
              this.handleCheckNCD()
              break;
            case '小区垃圾点':
              this.handleCheckXQCY()
              break;
            case '餐饮单位':
              this.handleCheckCY()
              break;
            default:
              break;
          }
        }
      });
    },
    changeMapfeature () {
      // item.active = !item.active
      // console.log(index);
      var mapStyle = [
        {
          "featureType": "land", //陆地
          "elementType": "all",
          "stylers": {
            "visibility": this.returnVisibility(this.mapFeatureList[1].active)
          }
        },
        {
          "featureType": "water", //水系
          "elementType": "all",
          "stylers": {
            "visibility": this.returnVisibility(this.mapFeatureList[2].active)
          }
        }, {
          "featureType": "green", //绿地
          "elementType": "all",
          "stylers": {
            "visibility": this.returnVisibility(this.mapFeatureList[3].active)
          }
        // }, {
        //   "featureType": "manmade", //人造区域
        //   "elementType": "all",
        //   "stylers": {
        //     "visibility": this.returnVisibility(this.mapFeatureList[6].active)
        //   }
        // }, {
        //   "featureType": "building", //建筑物
        //   "elementType": "all",
        //   "stylers": {
        //     "visibility": this.returnVisibility(this.mapFeatureList[4].active)
        //   }
        }, {
          "featureType": "road", //道路
          "elementType": "all",
          "stylers": {
            "visibility": this.returnVisibility(this.mapFeatureList[0].active)
          }
        }, {
          "featureType": "poilabel", //兴趣点
          "elementType": "all",
          "stylers": {
            "visibility": this.returnVisibility(this.mapFeatureList[4].active)
          }
        }
      ]
      console.log(this.mapFeatureList);
      this.map.setMapStyle({
        styleJson: mapStyle
      })
    },
    returnVisibility (active) {
      console.log(active);
      if (active) {
        return 'on';
      } else {
        return 'off';
      }
    },
    changeOperationValue (item, index) {

      item.active = !item.active

      switch (index) {
        case 0:
          this.drawMapV_Vehicle()
          break;
        case 1:
          this.drawMapV_Rubbish()
          break;
        case 2:
          this.drawMapV_Worker()
          break;
        case 3:
          this.drawMapV_ToiletCar()
          break;
        case 4:
          this.drawMapV_ToiletWorker()
          break;
        case 5:
          this.drawMapV_Toilet()
          break;
        case 6:
          this.handleCheckZZZ()
          break;
        case 7:
          this.handleCheckCLC()
          break;
        case 8:
          this.handleCheckNCD()
          break;
        case 9:
          this.handleCheckXQCY()
          break;
        case 10:
          this.handleCheckCY()
          break;
        default:
          break;
      }
    },
    handleTreeNodeCheckChange(data) {
      console.log(data);
    },
    renderContent(h, { node, data, store }) {
      if (data.subs != null) {
        var total = data.online + data.offline
        // return <span style="font-weight: bolder ">{node.label}</span>;
        return <span style="font-weight: bolder ">{node.label+'(总数:'+total+',在线数:'+data.online+',离线数:'+data.offline+')'}</span>;
      } else if (data.ISONLNE === "1") {
        return (
          <span style="color: #1E90FF;font-size: 0.733vw;">
            {node.label}（在线）
          </span>
        );
      } else {
        return (
          <span style="color: #969696;font-size: 0.733vw;">
            {node.label}（离线）
          </span>
        );
      }
    },
  }
}
</script>

<style scoped lang="less">
#allmap {
  position: relative;
  // height: calc(100% - 40px);
  height: 100%;
}
/deep/.BMap_cpyCtrl {
  display: none !important;
}
/deep/.anchorBL {
  display: none !important;
}
#map {
      height: 100%;
      width: 100%;
    }
.person_top {
  width: 150px;
  height: 130px;
  position: absolute;
  left: 10px;
  top: 10px;
  background-color: #b2dfee;
  border: 1px solid #ccc;
  p {
    height: 30px;
    // text-align: center;
    padding-left: 5px;
    padding-left: 10px;
    color: #333;
    span:first-child {
      text-align: center;
      padding-top: 14px;
      display: inline-block;
      width: 30px;
      height: 30px;
      margin-right: 5px;
      vertical-align: middle;
      img {
        // background-size: 30px 30px;
        height: 30px;
      }
    }
  }
}
.person_legend {
  width: 21.646vw;
  position: absolute;
  right: 0.521vw;
  bottom: 0.521vw;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 0.26vw 0.521vw 0 0.521vw;
  border-radius: 0.26vw;
  h3 {
    height: 1.563vw;
    text-align: center;
    line-height: 1.563vw;
    color: #333;
    margin-bottom: 0.26vw;
    i {
      float: right;
      cursor: pointer;
      &:before {
        color: #666;
      }
    }
  }
  p {
    // text-align: center;
    height: 3.229vw;
    color: #333;
    float: left;
    width: 19%;
    margin-bottom: 1.042vw;
    span {
      display: block;
      text-align: center;
      &:first-child {
        img {
          // background-size: 1.563vw 1.563vw;
          height: 2.083vw;
        }
      }
    }
  }
}
.status_legend {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 0 10px;
  background-color: #f3f3f3;
  border: 1px solid #ccc;
  .public {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 10px;
    margin-right: 2px;
  }
  .online {
    background-color: #1afa29;
  }
  .outline {
    background-color: blue;
  }
  .warning {
    background-color: red;
  }
}
.mini_legend {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #dcdfe6;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  color: #007acc;
  font-size: 14px;
  &.right {
    right: 10px;
    left: auto;
  }
}
.map-infos-wrap {
  position: absolute;
  left: 10px;
  top: 30px;
  height: 430px;
  .map-infos {
    background: rgba(255, 255, 255, 0.9);
    height: 500px;
    width: 350px;
    border-radius: 5px;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 100%;
    h3 {
      font-size: 15px;
      line-height: 26px;
      margin-left: 10px;
      i {
        float: right;
        font-style: normal;
        color: #666;
        font-size: 12px;
      }
    }
    .item-wrap {
      display: flex;
      margin-bottom: 20px;
      .item-con {
        flex: 1;
        text-align: center;
        h2 {
          margin-top: 10px;
          line-height: 30px;
          font-size: 20px;
        }
        span {

          font-size: 13px;
          color: #666;
        }
      }
    }
    .icon-wrap {
      margin: 10px 10px 10px 0;
      .icon-con {
        width: 33.33%;
        float: left;
        text-align: center;
        margin: 15px 0;
        position: relative;
        i {
          font-size: 20px;
          display: block;
          margin-bottom: 5px;
          color: #333;
        }
        .el-tag.el-tag--mini {
          position: absolute;
          right: 0;
          top: -8px;
          height: 15px;
          line-height: 15px;
          border-color: #e1dada;
          background: #e1dada;
          color: #666;
        }
        span {
          font-family:STHeiti;
          font-size: 14px;
          color: rgb(34, 34, 34);
        }
        &.hasColor {
          i {
            color: #007acc;
          }
          .el-tag.el-tag--mini {
            font-size: 14px;
            border-color: #007acc;
            background: #007acc;
            color: #fff;
          }
        }
      }
    }
    .map-checkboxs {
      margin-top: 10px;
      p {
        line-height: 30px;
      }
    }
    /deep/.el-progress-bar__outer {
      background: #d8d8d8;
    }
  }
  .info-tabs {
    position: absolute;
    right: -30px;
    top: 50px;
    background: rgba(255, 255, 255, 0.9);
    width: 30px;
    border-radius: 0 3px 3px 0;
    overflow: hidden;
    a {
      display: block;
      padding: 3px 3px 1px 3px;
      text-align: center;
      line-height: 24px;
      cursor: pointer;
      &.active {
        background: #007acc;
        i {
          color: #fff;
        }
      }
    }
  }
  /* 滚动条样式 */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
  }
}
/deep/.el-table.card-table {
  margin-top: 10px;
  background: none;
  thead,
  tbody {
    color: #333;
  }
  tr,
  th {
    background: none !important;
  }
  th div,
  td div {
    font-size: 14px;
  }
  tr:nth-child(2n) {
    background: none;
  }
  tr:hover > td {
    background: none !important;
  }
}
.map-operation {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: 32px;
  top: 10px;
  border-radius: 5px;
  ul {
    li {
      list-style: none;
      float: left;
      color: #ecf0f3;
      background: #b2bbbe;
      font-size: 16px;
      padding: 5px 12px;
      position: relative;
      cursor: pointer;
      border-radius: 2px;
      i {
        margin-right: 3px;
        margin-bottom: 3px;
        font-size: 14px;
        &:before {
          font-size: inherit;
          color: inherit;
        }
      }
      &::before {
        display: block;
        content: '';
        width: 1px;
        height: 13px;
        background: #dcdfe6;
        position: absolute;
        right: 0;
        top: 8px;
      }
      &:last-child {
        &::before {
          display: none;
        }
      }
      &.active {
        color: #fff;
        background: #007acc;
        border-radius: 2px;
      }
    }
  }
}
.row_box {
  width: 120px;
  // height: 130px;
  color: #666;
  background-color: #f3f3f3;
  border: 1px solid #ccc;
  position: fixed;
  span {
    display: block;
    text-align: center;
    line-height: 26px;
    cursor: default;
    &:hover {
      color: #fff;
      background-color: #409eff;
    }
  }
}
</style>
